/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.google.code.netcheckin.aprs;

/**
 *
 * @author cshields
 */
public class Station {

    public static final boolean MISSING_BOOL = false;
    public static final char    MISSING_CHAR = ' ';
//    public static final int     MISSING_INT = Integer.MAX_VALUE;
//    public static final float   MISSING_FLOAT = Float.MAX_VALUE;
    public static final int     MISSING_INT = 0;
    public static final float   MISSING_FLOAT = 0;
    public static final String  MISSING_STRING = null;
    
    protected String callsign;
    protected String name;
    protected boolean isAres                     = MISSING_BOOL;;
    protected boolean isRaces                    = MISSING_BOOL;;
    protected String cellphone;
    protected String email;
    protected String primaryDescription;
    protected String secondaryDescription;
    protected String primaryAddress;
    protected String secondaryAddress;
    protected String primaryCity;
    protected String secondaryCity;
    protected String primaryState;
    protected String secondaryState;
    protected String primaryZip;
    protected String secondaryZip;
    protected int primaryLatitude1               = MISSING_INT;
    protected float primaryLatitude2             = MISSING_FLOAT;
    protected char primaryLatitudeOrientation    = MISSING_CHAR;
    protected int secondaryLatitude1             = MISSING_INT;
    protected float secondaryLatitude2           = MISSING_FLOAT;
    protected char secondaryLatitudeOrientation  = MISSING_CHAR;
    protected int primaryLongitude1              = MISSING_INT;
    protected float primaryLongitude2            = MISSING_FLOAT;
    protected char primaryLongitudeOrientation   = MISSING_CHAR;
    protected int secondaryLongitude1            = MISSING_INT;
    protected float secondaryLongitude2          = MISSING_FLOAT;
    protected char secondaryLongitudeOrientation = MISSING_CHAR;
    protected String primaryIcon;
    protected String secondaryIcon;
    protected String comment;
    
    public Station() {
        
    }
    
    public void setCallsign(String callsign) {
        this.callsign = callsign;
    }
    
    public String getCallsign() {
        return this.callsign;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    public String getName() {
        return this.name;
    }
    
    public void setIsAres(boolean isAres) {
        this.isAres = isAres;
    }
    
    public boolean getIsAres() {
        return this.isAres;
    }
    
    public void setIsRaces(boolean isRaces) {
        this.isRaces = isRaces;
    }
    
    public boolean getIsRaces() {
        return this.isRaces;
    }
    
    public void setCellphone(String cellphone) {
        this.cellphone = cellphone;
    }
    
    public String getCellphone() {
        return this.cellphone;
    }
    
    public void setEmail(String email) {
        this.email = email;
    }
    
    public String getEmail() {
        return this.email;
    }
    
    public void setPrimaryDescription(String primaryDescription) {
	this.primaryDescription = primaryDescription;
    }

    public String getPrimaryDescription() {
	return this.primaryDescription;
    }

    public void setSecondaryDescription(String secondaryDescription) {
	this.secondaryDescription = secondaryDescription;
    }

    public String getSecondaryDescription() {
	return this.secondaryDescription;
    }

    public void setPrimaryAddress(String primaryAddress) {
        this.primaryAddress = primaryAddress;
    }
    
    public String getPrimaryAddress() {
        return this.primaryAddress;
    }
    
    public void setSecondaryAddress(String secondaryAddress) {
        this.secondaryAddress = secondaryAddress;
    }
    
    public String getSecondaryAddress() {
        return this.secondaryAddress;
    }
    
    public void setPrimaryCity(String primaryCity) {
        this.primaryCity = primaryCity;
    }
    
    public String getPrimaryCity() {
        return this.primaryCity;
    }

    public void setSecondaryCity(String secondaryCity) {
        this.secondaryCity = secondaryCity;
    }
    
    public String getSecondaryCity() {
        return this.secondaryCity;
    }

    public void setPrimaryState(String primaryState) {
	this.primaryState = primaryState;
    }

    public String getPrimaryState() {
	return this.primaryState;
    }

    public void setSecondaryState(String secondaryState) {
	this.secondaryState = secondaryState;
    }

    public String getSecondaryState() {
	return this.secondaryState;
    }

    public void setPrimaryZip(String primaryZip) {
        this.primaryZip = primaryZip;
    }
    
    public String getPrimaryZip() {
        return this.primaryZip;
    }
    
    public void setSecondaryZip(String secondaryZip) {
        this.secondaryZip = secondaryZip;
    }
    
    public String getSecondaryZip() {
        return this.secondaryZip;
    }
    
    public void setPrimaryLatitude1(int primaryLatitude1) {
        this.primaryLatitude1 = primaryLatitude1;
    }
    
    public int getPrimaryLatitude1() {
        return this.primaryLatitude1;
    }
    
    public void setPrimaryLatitude2(float primaryLatitude2) {
        this.primaryLatitude2 = primaryLatitude2;
    }
    
    public float getPrimaryLatitude2() {
        return this.primaryLatitude2;
    }
    
    public void setPrimaryLatitudeOrientation(char primaryLatitudeOrientation) {
        if (primaryLatitudeOrientation == 'N') {
            this.primaryLatitudeOrientation = primaryLatitudeOrientation;
        } else if (primaryLatitudeOrientation == 'S') {
            this.primaryLatitudeOrientation = primaryLatitudeOrientation;
        } else {
            throw new Error("Latitude Orientation is not N or S");
        }
    }
    
    public char getPrimaryLatitudeOrientation() {
        return this.primaryLatitudeOrientation;
    }
    
    public void setSecondaryLatitude1(int secondaryLatitude1) {
        this.secondaryLatitude1 = secondaryLatitude1;
    }
    
    public int getSecondaryLatitude1() {
        return this.secondaryLatitude1;
    }
    
    public void setSecondaryLatitude2(float secondaryLatitude2) {
        this.secondaryLatitude2 = secondaryLatitude2;
    }
    
    public float getSecondaryLatitude2() {
        return this.secondaryLatitude2;
    }
    
    public void setSecondaryLatitudeOrientation(char secondaryLatitudeOrientation) {
        if (secondaryLatitudeOrientation == 'N') {
            this.secondaryLatitudeOrientation = secondaryLatitudeOrientation;
        } else if (secondaryLatitudeOrientation == 'S') {
            this.secondaryLatitudeOrientation = secondaryLatitudeOrientation;
        } else {
            throw new Error("Latitude Orientation is not N or S");
        }
    }
    
    public char getSecondaryLatitudeOrientation() {
        return this.secondaryLatitudeOrientation;
    }
    
    public void setPrimaryLongitude1(int primaryLongitude1) {
        this.primaryLongitude1 = primaryLongitude1;
    }
    
    public int getPrimaryLongitude1() {
        return this.primaryLongitude1;
    }
    
    public void setPrimaryLongitude2(float primaryLongitude2) {
        this.primaryLongitude2 = primaryLongitude2;
    }
    
    public float getPrimaryLongitude2() {
        return this.primaryLongitude2;
    }
    
    public void setPrimaryLongitudeOrientation(char primaryLongitudeOrientation) {
        if (primaryLongitudeOrientation == 'E') {
            this.primaryLongitudeOrientation = primaryLongitudeOrientation;
        } else if (primaryLongitudeOrientation == 'W') {
            this.primaryLongitudeOrientation = primaryLongitudeOrientation;
        } else {
            throw new Error("Longitude Orientation is not E or W");
        }
    }
    
    public char getPrimaryLongitudeOrientation() {
        return this.primaryLongitudeOrientation;
    }
    
    public void setSecondaryLongitude1(int secondaryLongitude1) {
        this.secondaryLongitude1 = secondaryLongitude1;
    }
    
    public int getSecondaryLongitude1() {
        return this.secondaryLongitude1;
    }
    
    public void setSecondaryLongitude2(float secondaryLongitude2) {
        this.secondaryLongitude2 = secondaryLongitude2;
    }
    
    public float getSecondaryLongitude2() {
        return this.secondaryLongitude2;
    }
    
    public void setSecondaryLongitudeOrientation(char secondaryLongitudeOrientation) {
        if (secondaryLongitudeOrientation == 'E') {
            this.secondaryLongitudeOrientation = secondaryLongitudeOrientation;
        } else if (secondaryLongitudeOrientation == 'W') {
            this.secondaryLongitudeOrientation = secondaryLongitudeOrientation;
        } else {
            throw new Error("Longitude Orientation is not E or W");
        }
    }
    
    public char getSecondaryLongitudeOrientation() {
        return this.secondaryLongitudeOrientation;
    }
    
    public void setPrimaryIcon(String primaryIcon) {
        this.primaryIcon = primaryIcon;
    }
    
    public String getPrimaryIcon() {
        return this.primaryIcon;
    }
    
    public void setSecondaryIcon(String secondaryIcon) {
        this.secondaryIcon = secondaryIcon;
    }
    
    public String getSecondaryIcon() {
        return this.secondaryIcon;
    }
    
    public void setComment(String comment) {
        this.comment = comment;
    }
    
    public String getComment() {
        return this.comment;
    }
    
    public boolean isPrimaryCoordinateValid() {
        if ((getPrimaryLatitude1() == MISSING_INT) || 
            (getPrimaryLongitude1() == MISSING_INT) ||
            (getPrimaryLatitude2() == MISSING_FLOAT) ||
            (getPrimaryLongitude2() == MISSING_FLOAT) ||
            (Math.abs(getPrimaryLatitude1()) > 90) ||
            (Math.abs(getPrimaryLongitude1()) > 180) ||
            (Math.abs(getPrimaryLatitude2()) > 100.0) ||
            (Math.abs(getPrimaryLongitude2()) > 100.00)) {
            return false;
        }
        return true;
    }
    
    public boolean isSecondaryCoordinateValid() {
        if ((getSecondaryLatitude1() == MISSING_INT) || 
            (getSecondaryLongitude1() == MISSING_INT) ||
            (getSecondaryLatitude2() == MISSING_FLOAT) ||
            (getSecondaryLongitude2() == MISSING_FLOAT) ||
            (Math.abs(getSecondaryLatitude1()) > 90) ||
            (Math.abs(getSecondaryLongitude1()) > 180) ||
            (Math.abs(getSecondaryLatitude2()) > 100.0) ||
            (Math.abs(getSecondaryLongitude2()) > 100.00)) {
            return false;
        }
        return true;
    }
}
